package com.example.musictutor.activities;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.Toast;
import com.example.musictutor.R;

/**
 * Created by ironhulk on 2014/05/07.
 */
public class ProgressLevelSelect extends Activity {

    Context context = this;
    String passColor = "#ff86ff88";
    String lockedColor = "#ffff2f38";

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.progress_level_select);

        Button btnLevel1 = (Button) findViewById(R.id.btnLevel1);
        Button btnLevel2 = (Button) findViewById(R.id.btnLevel2);
        Button btnLevel3 = (Button) findViewById(R.id.btnLevel3);
        Button btnLevel4 = (Button) findViewById(R.id.btnLevel4);
        Button btnLevel5 = (Button) findViewById(R.id.btnLevel5);

        View panelLevel1 = findViewById(R.id.panelLevel1);
        panelLevel1.setVisibility(View.VISIBLE);
        Toast.makeText(context,"Click On The Progress Report Icon To View Results",1).show();

        View panelLevel2 = findViewById(R.id.panelLevel2);
        panelLevel2.setVisibility(View.GONE);

        View panelLevel3 = findViewById(R.id.panelLevel3);
        panelLevel3.setVisibility(View.GONE);

        View panelLevel4 = findViewById(R.id.panelLevel4);
        panelLevel4.setVisibility(View.GONE);

        View panelLevel5 = findViewById(R.id.panelLevel5);
        panelLevel5.setVisibility(View.GONE);

        final ImageButton level1Progress = (ImageButton)findViewById(R.id.levelImageButton);

        btnLevel1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // DO STUFF
                View panelLevel1 = findViewById(R.id.panelLevel1);
                panelLevel1.setVisibility(View.VISIBLE);

                View panelLevel2 = findViewById(R.id.panelLevel2);
                panelLevel2.setVisibility(View.GONE);

                View panelLevel3 = findViewById(R.id.panelLevel3);
                panelLevel3.setVisibility(View.GONE);

                View panelLevel4 = findViewById(R.id.panelLevel4);
                panelLevel4.setVisibility(View.GONE);

                View panelLevel5 = findViewById(R.id.panelLevel5);
                panelLevel5.setVisibility(View.GONE);

            }
        });

        btnLevel2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                Toast.makeText(context,"The Level Is Locked",1).show();

                View panelLevel1 = findViewById(R.id.panelLevel1);
                panelLevel1.setVisibility(View.GONE);

                View panelLevel2 = findViewById(R.id.panelLevel2);
                panelLevel2.setVisibility(View.VISIBLE);

                View panelLevel3 = findViewById(R.id.panelLevel3);
                panelLevel3.setVisibility(View.GONE);

                View panelLevel4 = findViewById(R.id.panelLevel4);
                panelLevel4.setVisibility(View.GONE);

                View panelLevel5 = findViewById(R.id.panelLevel5);
                panelLevel5.setVisibility(View.GONE);

            }
        });

        btnLevel3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                Toast.makeText(context,"The Level Is Locked",1).show();

                View panelLevel1 = findViewById(R.id.panelLevel1);
                panelLevel1.setVisibility(View.GONE);

                View panelLevel2 = findViewById(R.id.panelLevel2);
                panelLevel2.setVisibility(View.GONE);

                View panelLevel3 = findViewById(R.id.panelLevel3);
                panelLevel3.setVisibility(View.VISIBLE);

                View panelLevel4 = findViewById(R.id.panelLevel4);
                panelLevel4.setVisibility(View.GONE);

                View panelLevel5 = findViewById(R.id.panelLevel5);
                panelLevel5.setVisibility(View.GONE);

            }
        });

        btnLevel4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                Toast.makeText(context,"The Level Is Locked",1).show();

                View panelLevel1 = findViewById(R.id.panelLevel1);
                panelLevel1.setVisibility(View.GONE);

                View panelLevel2 = findViewById(R.id.panelLevel2);
                panelLevel2.setVisibility(View.GONE);

                View panelLevel3 = findViewById(R.id.panelLevel3);
                panelLevel3.setVisibility(View.GONE);

                View panelLevel4 = findViewById(R.id.panelLevel4);
                panelLevel4.setVisibility(View.VISIBLE);

                View panelLevel5 = findViewById(R.id.panelLevel5);
                panelLevel5.setVisibility(View.GONE);

            }
        });


        btnLevel5.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                Toast.makeText(context,"The Level Is Locked",1).show();

                View panelLevel1 = findViewById(R.id.panelLevel1);
                panelLevel1.setVisibility(View.GONE);

                View panelLevel2 = findViewById(R.id.panelLevel2);
                panelLevel2.setVisibility(View.GONE);

                View panelLevel3 = findViewById(R.id.panelLevel3);
                panelLevel3.setVisibility(View.GONE);

                View panelLevel4 = findViewById(R.id.panelLevel4);
                panelLevel4.setVisibility(View.GONE);

                View panelLevel5 = findViewById(R.id.panelLevel5);
                panelLevel5.setVisibility(View.VISIBLE);

            }
        });

        level1Progress.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //Toast.makeText(context,"Option :" + optionColorValue,Toast.LENGTH_LONG).show();
                startActivity(new Intent(context,UserProgress.class));
            }
        });

    }
}